package cn.yangliu.kindeditor.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 作者 杨柳
 * 时间 2017-09-24 17:17
 * 描述
 */
@ConfigurationProperties(prefix = "spring.kind-editor")
public class KindeditorProperties {

    public KindeditorProperties(){
        KindEditorConfig.configPath=null;
    }
    //全局访问前缀
    private String globalUrlPreffix = "/kindeditorShow";
    //保存路径前缀
    private String globalSavePathPreffix = "/kindeditor";
    //媒体文件
    private String mediaAllow = "swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb,mp4";
    //附件
    private String fileAllow = "doc,docx,xls,xlsx,ppt,htm,html,txt,zip,rar,gz,bz2";
    //flash
    private String flashAllow = "swf,flv";
    //图片
    private String imageAllow = "gif,jpg,jpeg,png,bmp";
    //文件上传统一最大限制
    private long maxSize = 52428800L;

    //上传文件url
    private String uploadUrl="/kindeditorUpload";

    //文件管理url
    private String fileUrl="/kindeditorFiles";

    public String getUploadUrl() {
        return uploadUrl;
    }

    public void setUploadUrl(String uploadUrl) {
        this.uploadUrl = uploadUrl;
    }

    public String getFileUrl() {
        return fileUrl;
    }

    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }

    public String getGlobalUrlPreffix() {
        return globalUrlPreffix;
    }

    public void setGlobalUrlPreffix(String globalUrlPreffix) {
        KindEditorConfig.globalUrlPreffix = globalUrlPreffix;
        this.globalUrlPreffix = globalUrlPreffix;
    }

    public String getGlobalSavePathPreffix() {
        return globalSavePathPreffix;
    }

    public void setGlobalSavePathPreffix(String globalSavePathPreffix) {
        KindEditorConfig.globalSavePathPreffix = globalSavePathPreffix;
        this.globalSavePathPreffix = globalSavePathPreffix;
    }

    public String getMediaAllow() {
        return mediaAllow;
    }

    public void setMediaAllow(String mediaAllow) {
        KindEditorConfig.mediaAllow = mediaAllow;
        this.mediaAllow = mediaAllow;
    }

    public String getFileAllow() {
        return fileAllow;
    }

    public void setFileAllow(String fileAllow) {
        KindEditorConfig.fileAllow = fileAllow;
        this.fileAllow = fileAllow;
    }

    public String getFlashAllow() {
        return flashAllow;
    }

    public void setFlashAllow(String flashAllow) {
        KindEditorConfig.flashAllow = flashAllow;
        this.flashAllow = flashAllow;
    }

    public String getImageAllow() {
        return imageAllow;
    }

    public void setImageAllow(String imageAllow) {
        KindEditorConfig.imageAllow = imageAllow;
        this.imageAllow = imageAllow;
    }

    public long getMaxSize() {
        return maxSize;
    }

    public void setMaxSize(long maxSize) {
        KindEditorConfig.maxSize = maxSize+"";
        this.maxSize = maxSize;
    }
}
